package com.qf.controller;

/**
 * @version 1.0
 * @auther Administrator
 * @date 2023/2/25 9:49
 */
//@RequestMapping("/admin/groupon")
//@RestController
//@CrossOrigin
public class GrouponRulesController {

//    @Autowired
//    private DtsGrouponRulesService dtsGrouponRulesService;
//
//    @RequiresPermissions(value = "admin:groupon:list")
//    @RequiresPermissionsDesc(menu = {"推广管理","团购规则"},button = "查询")
//    @GetMapping("/list")
//    public Object list(String goodsId, String sort, String order,
//                       @RequestParam(defaultValue = "1") Integer page,
//                       @RequestParam(defaultValue = "20") Integer limit){
//
//        IPage<DtsGrouponRules> iPage = dtsGrouponRulesService.findListByQuery(goodsId,sort,order,page,limit);
//        Map data = new HashMap<>();
//        data.put("total",iPage.getTotal());
//        data.put("items",iPage.getRecords());
//        return ResponseUtil.ok(data);
//    }
//
//    @RequiresPermissions(value = "admin:groupon:listRecord")
//    @RequiresPermissionsDesc(menu = {"推广管理","团购规则"},button = "查询")
//    @GetMapping("/listRecord")
//    public Object listRecord(String goodsId, String sort, String order,
//                       @RequestParam(defaultValue = "1") Integer page,
//                       @RequestParam(defaultValue = "20") Integer limit){
//
//        IPage<DtsGrouponRules> iPage = dtsGrouponRulesService.findListByQuery(goodsId,sort,order,page,limit);
//        Map data = new HashMap<>();
//        data.put("total",iPage.getTotal());
//        data.put("items",iPage.getRecords());
//        return ResponseUtil.ok(data);
//    }
//
//    /**
//     * /create
//     */
//    @RequiresPermissions(value = "admin:groupon:create")
//    @RequiresPermissionsDesc(menu = {"推广管理","团购规则"},button = "添加")
//    @PostMapping("/create")
//    public Object create(@RequestBody DtsGrouponRules dtsGrouponRules){
//        dtsGrouponRules = dtsGrouponRulesService.create(dtsGrouponRules);
//        return ResponseUtil.ok(dtsGrouponRules);
//
//    }
}
